﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace BLL.View
{
    public class T_PUB_CUSTOMERINFO
    {
        private readonly DALL.View.T_PUB_CUSTOMERINFO dal = new DALL.View.T_PUB_CUSTOMERINFO();
        public T_PUB_CUSTOMERINFO()
        { }

        /// <summary>
        /// 智能提示客户姓名
        /// </summary>
        /// <returns></returns>
        public DataSet GetCustomerName()
        {
            return dal.GetCustomerName();
        }

        /// <summary>
        /// 智能提示客户新郎姓名
        /// </summary>
        /// <returns></returns>
        public DataSet GetGroomName()
        {
            return dal.GetGroomName();
        }

        /// <summary>
        /// 智能提示客户新娘姓名
        /// </summary>
        /// <returns></returns>
        public DataSet GetBrideName()
        {
            return dal.GetBrideName();
        }

        #region  Method
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(Model.View.T_PUB_CUSTOMERINFO model)
        {
            return dal.Add(model);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Model.View.T_PUB_CUSTOMERINFO model)
        {
            return dal.Update(model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(string CUSTOMER_ID)
        {

            return dal.Delete(CUSTOMER_ID);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Model.View.T_PUB_CUSTOMERINFO GetModel(string CUSTOMER_ID)
        {

            return dal.GetModel(CUSTOMER_ID);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strName)
        {
            string strWhere = "";
            if (strName != "")
            {
                strWhere = string.Format("GROOM_NAME like %{0}% or BRIDE_NAME like %{0}%", strName);
            }
            return dal.GetList(strWhere);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<Model.View.T_PUB_CUSTOMERINFO> GetModelList(string strWhere)
        {
            return dal.GetListArray(strWhere);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetAllList()
        {
            return GetList("");
        }
        #endregion
    }
}
